#include <iostream>
#include <OpenGL/glu.h>
#include <OpenGL/OpenGL.h>
#include <GLUT/glut.h>



void display()
{
	
    glBegin(GL_LINE_LOOP);
 	glColor3f( 1.0f, 0.0f, 0.0f);
    glVertex2f(0.0f, 0.0f);
    glColor3f( 0.0f, 1.0f, 0.0f);
    glVertex2f(0.0f, 80.0f);
    glColor3f( 0.0f, 0.0f, 1.0f);
    glVertex2f(80.0f, 80.0f);
    glColor3f( 0.0f, 0.0f, 1.0f);
    glVertex2f(80.0f, 120.0f);
    
    glColor3f( 1.0f, 0.0f, 0.0f);
    glVertex2f(80.0f, 80.0f);
    glColor3f( 0.0f, 1.0f, 0.0f);
    glVertex2f(80.0f, 80.0f);
    glColor3f( 0.0f, 0.0f, 1.0f);
    glVertex2f(80.0f, 80.0f);
    glColor3f( 0.0f, 0.0f, 1.0f);
    glVertex2f(80.0f, 120.0f);
    
    glEnd();
    glFlush();
}

void init()
{
    glClear(GL_COLOR_BUFFER_BIT);
    //    glLineWidth(5);
    glMatrixMode(GL_PROJECTION);
    gluOrtho2D(0.0, 200, 0.0, 150);
}

int main(int argc, const char * argv[]) {
    // insert code here...
    std::cout << "Hello, World!\n";
    glutInit(&argc, (char**)argv);
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
    glutInitWindowPosition(50, 100);
    glutInitWindowSize(400, 300);
    glutCreateWindow("my Glut windows");
    
    init();
    
    printf("cocos2d: GL_VENDOR:     %s\n", glGetString(GL_VENDOR));
    printf("cocos2d: GL_RENDERER:   %s\n", glGetString(GL_RENDERER));
    printf("cocos2d: GL_VERSION:    %s\n", glGetString(GL_VERSION));

    
    
    glutDisplayFunc(display);
    glutMainLoop();
    return 0;
}